<template>
	<view class="collect">
<course v-if="course.length>0" :courses="course"></course>
<none v-else ></none>
	</view>
</template>

<script>
	import course from '@/components/course.vue'
	import none from '@/components/none.vue'
	import {getCollectClass} from '@/request/user.js'
	export default{
		components:{course,none},
		data(){
			return{
				page:1,
				page_size:10,
				course:[]
			}
		},
		// onLoad: function (options) {
		//        setTimeout(function () {
		//            console.log('下拉刷新');
		//        }, 500);
		//        uni.startPullDownRefresh();
		//    },
		   onPullDownRefresh() {
		       console.log('停止刷新');
		       setTimeout(function () {
		           uni.stopPullDownRefresh();
		       }, 500);
		   },
		onShow() {
			this.getClass()
		
		},
		methods:{
			text(){
					console.log(this.course)
			},
			async getClass(){
				let res = await getCollectClass({
					page:this.page,
					page_size:this.page_size
				})
				console.log(res)
				this.course=res.data.data.data
				console.log(this.course)
			}
		}
	}
</script>

<style lang="less">
	
</style>
